<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Models\User;

class CalculateActiveUser extends Command
{
    //供我们调用命令
    protected $signature = 'larabbs:calculate-active-user';
    //命令描述
    protected $description = '生成活跃用户';
    //执行最终方法
    public function handle(User $user)
    {
        $this->info('开始计算..');
        $user->calculateAndCacheActiveUsers();
        $this->info('成功生成！');
    }
}
